
from setting import BASE_URL,CAPS
from appium import webdriver


# 初始化driver
def driver():
    return webdriver.Remote(BASE_URL,CAPS)


# 获取屏幕
def get_size(driver):
    x = driver.get_window_size()['width']       # width 为x坐标
    y = driver.get_window_size()['height']      # height为y坐标
    return (x,y)


# 向上滑动的操作
def swipe_up(driver):
    l = get_size(driver)
    x1 = int(l[0] * 0.5)
    y1 = int(l[1] * 0.75)
    y2 = int(l[1] * 0.25)
    driver.swipe(x1,y1,x1,y2,y2+300)





if __name__ == '__main__':
    driver()

